#include <stdio.h>
#include <stdlib.h>
#pragma once
typedef int DataStack;
typedef struct Stack
{
	int *arr;
	int capacity;
	int size;
	int top;
}Stack;
void StackInit(Stack *stack,int capacity)
{
	stack->arr = (int *)malloc(sizeof(int)*capacity);
	stack->capacity = capacity;
	stack->size = 0;
	stack->top = 0;
}
void PushStack(Stack *stack, DataStack data)
{
	if (stack->top >= stack->capacity)
		return;
	stack->arr[stack->top] = data;
	stack->top++;
	stack->size++;
}
DataStack PopStack(Stack *stack)
{
	if (stack->size <= 0)
		return -1;
	stack->top--;
	stack->size--;
	return stack->arr[stack->top];
}